//package com.chat.api.config;
//
//
//import com.rabbitmq.client.Connection;
//import com.rabbitmq.client.ConnectionFactory;
//import org.springframework.amqp.core.*;
//import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.beans.factory.annotation.Value;
//
//import java.io.IOException;
//import java.util.concurrent.TimeoutException;
//
//@Configuration
//public class RabbitConfig {
//
//    @Value("${spring.rabbitmq.host}")
//    private static String addresses;
//
//    @Value("${spring.rabbitmq.port}")
//    private static Integer port;
//
//    @Value("${spring.rabbitmq.username}")
//    private static String username;
//
//    @Value("${spring.rabbitmq.password}")
//    private static String password;
//
//    @Value("${spring.rabbitmq.virtual-host}")
//    private static String virtualHost;
//
//    final static String message1 = "q_topic_message1";
//    final static String message2 = "q_topic_message2";
//
////    @Bean
////    public Queue helloQueue() {
////        return new Queue("helloQueue1");
////    }
////
////    @Bean
////    public Queue userQueue() {
////        return new Queue("user");
////    }
//
//    /**
//     * 声明一个Topic类型的交换机
//     * @return
//     */
//    @Bean
//    TopicExchange exchange() {
//        return new TopicExchange("mybootexchange");
//    }
//
////    @Bean
////    public static Connection connectionFactory() throws IOException, TimeoutException {
////
////        ConnectionFactory connectionFactory = new ConnectionFactory();
////        connectionFactory.setHost(addresses);
////        connectionFactory.setPort(port);
////        connectionFactory.setUsername(username);
////        connectionFactory.setPassword(password);
////        connectionFactory.setVirtualHost(virtualHost);
////        Connection connection = connectionFactory.newConnection();
////        return connection;
////    }
//
//
//}